// stores/textInput.js
import { defineStore } from 'pinia'

export const useTextInputStore = defineStore('textInput', {
    state: () => ({
        inputValue: '',
        callbackKey: '', // 用于标识回调
        extraData: new Map()
    }),

    actions: {
        setInputValue(key,value) {
            this.callbackKey = key
            this.extraData.set(key,value)
        },

        setTitle(title) {
            this.title = title
        },

        setCallbackKey(key) {
            this.callbackKey = key
        },

        clear() {
            this.inputValue = ''
            this.callbackKey = ''
        }
    }
})
